import request from "@/utils/request";

export function getMachineList(params) {
  return request({
    url: "/machine/page",
    method: "get",
    params
  });
}


export function getMachineNoPage() {
  return request({
    url: `/machine/list`,
    method: "get"
  });
}

export function getMachineById(id) {
  return request({
    url: `/machine/${id}`,
    method: "get"
  });
}

export function addMachine(data) {
  return request({
    url: "/machine",
    method: "post",
    data
  });
}

export function updateMachine(data) {
  return request({
    url: "/machine",
    method: "put",
    data
  });
}

export function deleteMachine(id) {
  return request({
    url: `/machine/${id}`,
    method: "delete"
  });
}



export function addAnswer(params) {
  return request({
    url: "/answer",
    method: "get",
    params
  });
}

export function getAnswerList(params) {
  return request({
    url: "/answer/product/page",
    method: "get",
    params
  });
}

export function getAnswerById(id) {
  return request({
    url: `/answer/${id}`,
    method: "get"
  });
}

export function updateAnswer(data) {
  return request({
    url: "/answer/sort",
    method: "put",
    data
  });
}

export function updateAnswerApi(data) {
  return request({
    url: "/answer",
    method: "put",
    data
  });
}

export function deleteAnswer(id) {
  return request({
    url: `/answer/${id}`,
    method: "delete"
  });
}

export function addAnswerItem(data) {
  return request({
    url: "/answer",
    method: "post",
    data
  });
}



export function getQuestionList(params) {
  return request({
    url: "/answer/question/page",
    method: "get",
    params
  });
}


export function deleteAnswerProduct(id) {
  return request({
    url: `/answer/product/${id}`,
    method: "delete"
  });
}


export function getAnswerProductList(params) {
  return request({
    url: "/answer/record/page",
    method: "get",
    params
  });
}
export function answerenableStatus(data) {
  return request({
    url: "/answer/enableStatus",
    method: "put",
    data
  });
}
